﻿using Castle.DynamicProxy;
using Microsoft.Extensions.Caching.Memory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Extensions
{
    public interface ICaching
    {
        string SetCacheKey(IInvocation invocation);
        /// <summary>
        /// 设置缓存
        /// </summary>
        /// <param name="cacheKey"></param>
        /// <param name="cacheValue"></param>
        void SetCache(string cacheKey,object cacheValue, MemoryCacheEntryOptions options);
        /// <summary>
        /// 获取缓存
        /// </summary>
        /// <param name="cahcheKey"></param>
        /// <returns></returns>
        object GetCache(string cahcheKey);
        /// <summary>
        /// 删除缓存
        /// </summary>
        /// <param name="cacheKey"></param>
        /// <returns></returns>
        bool DelCache(string cacheKey);
        /// <summary>
        /// 判断缓存是否存在
        /// </summary>
        /// <param name="cacheKey"></param>
        /// <returns></returns>
        bool Exists(string cacheKey);
    }
}
